module.exports = function (sequelize, Sequelize) {
	// 购物车模型
	return sequelize.define("CartModel", {
		id: { 
			type: Sequelize.INTEGER, 
			primaryKey: true,
			autoIncrement: true
		},
		user_id: {
			type: Sequelize.INTEGER,
			allowNull:false,
			validate: {
				isInt: true,
				notNull: true
			},
		},
		good_id: {
			type: Sequelize.INTEGER,
			allowNull:false,
			validate: {
				isInt: true,
				notNull: true
			},
		},
		good_count: {
			type: Sequelize.INTEGER,
			allowNull:false,
			validate: {
				isInt: true,
				notNull: true
			},
		},
		cat_one_id: {
			type: Sequelize.INTEGER,
			validate: {
				isInt: true,
			},
		},
		cat_two_id: {
			type: Sequelize.INTEGER,
			validate: {
				isInt: true,
			},
		},
		cat_three_id: {
			type: Sequelize.INTEGER,
			validate: {
				isInt: true,
			},
		},
		
	}, {
		tableName: "cart"
	});
}